function price = underlyingpath_dw(S0, mu, sigma, T, N)

deltaT = T / N;
path1 = zeros(N + 1, 1);
path2 = zeros(N + 1, 1);
path1(1) = S0;
path2(1) = S0;

for i = 2 : N + 1
    z = randn(1);
    path1(i) = path1(i - 1) * exp((mu - sigma^2 / 2) * deltaT + sigma * sqrt(deltaT) * z);
    path2(i) = path2(i - 1) * exp((mu - sigma^2 / 2) * deltaT + sigma * sqrt(deltaT) * (-z));

end
price = [path1, path2];

end